home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qbsub10.arc / PARSEDMO.ASC < prev    next >
Encoding:
Text File  |  1986-06-25  |  1.3 KB  |  45 lines

  1. ' PARS.ASC -- MSDOS QuickBASIC demonstration of PARSE.SUB    25 June 85
  2. '        by David L. Poskie     (608) 274-9560
  3. '                  7118 Raymond Rd. Madison, WI 53719
  4. ' Please run any suggestions, corrections, additions, or changes by me.
  5. ' I can be messaged on all the major Madison, WI RBBS's.
  6.  
  7.     ' This variable is adjustable
  8.     NumMax = 10                ' Maximum # of commands allowed
  9.     DIM Cmd$(NumMax) 
  10. GOTO Start
  11.     Rem    $Include: 'OMNI.SUB'
  12.     Rem    $Include: 'PARSE.SUB'
  13.  
  14. Start:
  15.     COLOR 14 , 3 , 8
  16.     CLS
  17.     LOCATE 10,1
  18.     GOSUB Parse
  19.     ' If there is no command
  20.     IF Num = 0                            _
  21.        THEN SOUND 3333,.3 :                        _
  22.         Text$ = "Syntax: PARSEDMO Cmd-1 Cmd-2 . . Cmd-10" :        _
  23.         GOSUB Center :                        _
  24.         PRINT : PRINT :                        _
  25.         Text$ = "Commands must be separated by one or more spaces": _
  26.         GOSUB Center :                        _
  27.         GOTO ParsExit
  28.     ' If one or more commands exist
  29.     Text$ = "The command line contained " + STR$(Num) + " command"
  30.     IF Num > 1                            _
  31.        THEN Text$ = Text$ + "s"
  32.     Text$ = Text$ + "."
  33.     CLS
  34.     LOCATE 2 , 1
  35.     GOSUB Center
  36.     PRINT  
  37.     FOR Temp = 1 TO Num
  38.         Text$ = "Command #" + STR$(Temp) + " is " + Cmd$(Temp)
  39.         GOSUB Center 
  40.         IF    Temp < Num                        _
  41.         THEN PRINT
  42.     NEXT Temp
  43. ParsExit:
  44. SYSTEM
  45.